#include <atlbase.h>

#include <string>
#include <algorithm>
#include <memory>

#include "SelectElement.h"

using namespace std;


CSelectElement::CSelectElement(void)
{
}


CSelectElement::~CSelectElement(void)
{
}

void CSelectElement::DoFill(IHTMLDocument2* document) throw(...)
{
	if(!document)
		throw wstring(L"Input parameter document is null!");

	//TODO:
}

//void CSelectElement::InitElementFromXml(IXmlReader* pReader) throw(...)
//{
//	HRESULT hr;
//	XmlNodeType nodeType;
//	const WCHAR* pwszBuffer;
//
//	
//	//TODO:
//	CElement::InitElementFromXml(pReader);
//}


void CSelectElement::BuildAvailableAttributes() throw()
{
	_maa[L"value"]		= L"";
	_maa[L"index"]		= L"";
	_maa[L"trigger"]		= L"onchange";
}



void CSelectElement::ValidateAttributes() const throw(...)
{
	if(_maa.find(L"value")->second == L"" &&
		_maa.find(L"index")->second == L"")
		throw wstring(L"One and only one of the attributes 'value' and 'index' must be filled");
}